﻿@model Forest.Cat.Admin.Models.JobHunting.JobAlertModel
@using Forest.Cat.Domain.Entities
@{
    ViewBag.Title = "职位搜索器";
    Layout = "~/Administration/Views/Shared/_AdminLayout.cshtml";
}
<script type="text/javascript">
    $(document).ready(function () {
        $('#jobCategoryList1').val($('#Categories').val());
        $('#btnSubmit').bind('click', function () {
            $('#Categories').val($('#jobCategoryList1').val());
        });
    });
</script>
@using (Html.BeginForm("SavedSearchEdit", "JobHunting", FormMethod.Post))
{
    <div class="savedsearch_right">
        <div class="savedsearch_manage_right_title">
            @ViewBag.Title</div>
        <div class="savedsearch_manage_right_box">
            <p>
                <b>设定完成，可以按下方的"试算职缺数"，了解当前条件下的职缺情况</b></p>
            <div class="position_rebook">
                <div class="position_rebook_title">
                    新建职位搜索器</div>
                <div class="position_form">
                    <ul>
                        <li>
                            <p>
                                职位类型:</p>
                            @{
    var radioButtonList = new SelectList(new List<SelectListItem> {
                    new SelectListItem { Text = "不限", Value="105101", Selected=true },
                    new SelectListItem { Text = "正式", Value="105102"},
                    new SelectListItem { Text = "兼职", Value="105103"},
                    new SelectListItem { Text = "实习", Value="105104"},
                    new SelectListItem { Text = "派遣", Value="105105"},
                    new SelectListItem { Text = "其他", Value="105999"},
                    }, "Value", "Text", "false");

    var htmlAttributes = new Dictionary<string, object> {
                    { "class", "radioButtonList" },
                    { "onclick", "if(eval(this.value)) { $('#tblDate').show('slow'); } else { $('#tblDate').hide('slow'); return false; }" }
                };    
                            }
                            @foreach (var radiobutton in radioButtonList)
                            { 

                                @Html.RadioButtonFor(m => m.JobTypeString, @radiobutton.Value) @radiobutton.Text
                            }</li>
                        <li>
                            <p>
                                发布时间:</p>
                            @{
                            var radioButtonList2 = new SelectList(new List<SelectListItem> {
                    new SelectListItem { Text = "不限", Value="102101", Selected=true },
                    new SelectListItem { Text = "近一天", Value="102103"},
                    new SelectListItem { Text = "近两天", Value="102104"},
                    new SelectListItem { Text = "近三天", Value="102105"},
                    new SelectListItem { Text = "近一周", Value="102106"},
                    new SelectListItem { Text = "近两周", Value="102107"},
                    new SelectListItem { Text = "近一月", Value="102102"},                  
                    new SelectListItem { Text = "近两月", Value="102109"},
                    }, "Value", "Text", "false");

                            var htmlAttributes2 = new Dictionary<string, object> {
                    { "class", "radioButtonList2" },
                    { "onclick", "if(eval(this.value)) { $('#tblDate').show('slow'); } else { $('#tblDate').hide('slow'); return false;}" }
                };    
                            }
                            @foreach (var radiobutton in radioButtonList2)
                            {
                                @Html.RadioButtonFor(m => m.PostedDurationString, @radiobutton.Value) @radiobutton.Text
                            }
                        </li>
                        <li>
                            <p>
                                职位分类</p>
                            @{var index = 0;}
                            <select id="jobCategoryList1">
                                @foreach (var item in ViewBag.JobCategoryList)
                                {
                                    if (index == 0)
                                    {
                                    <option value="">请选择:</option>    
                                    }
                                    index++;
                                    <optgroup label="@item.Name">
                                        <!--循环显示子类-->
                                        @foreach (var subItem in (ViewBag.SubJobCategoryList as List<Lov>).Where(x => x.ParentId.Value.Equals(item.Id)))
                                        {
                                            <option value="@subItem.Value">@subItem.Name</option>
                                        }
                                    </optgroup>
                                }
                            </select></li>
                        <li>
                            <p>
                                行业类别</p>
                            @Html.DropDownListFor(
                            x => x.Industry,
                          ViewBag.Industrys as SelectList,
                           "请选择:",
                            new { @class = "long_select" })</li>
                        <li>
                            <p>
                                学历要求</p>
                            @Html.DropDownListFor(
                             x => x.EducationLevel,
                             ViewBag.EducationLevels as SelectList,
                             "请选择:",
                            new { @class = "long_select" })</li>
                        <li>
                            <p>
                                工作年限</p>
                            @Html.DropDownListFor(
                      x => x.YearsOfService,
                      ViewBag.YearsOfExperiences as SelectList,
                             "请选择:",
                            new { @class = "long_select" })</li>
                        <li>
                            <p>
                                公司性质</p>
                            @Html.DropDownListFor(
                     x => x.CompanyType,
                     ViewBag.CompanyTypes as SelectList,
                             "请选择:",
                            new { @class = "long_select" })</li>
                        <li>
                            <p>
                                月薪范围</p>
                            @Html.DropDownListFor(
                    x => x.SalaryRange,
                    ViewBag.SalaryRanges as SelectList,
                             "请选择",
                            new { @class = "long_select" })</li>
                        @*  <li class="trial">
                    @Html.BeginForm("", "JobHunting", FormMethod.Post)
                    { <span>
                        <img src="/Themes/DarkOrange/Content/images/icons-trial-64-19.jpg" alt="" width="64"
                            height="19" />
                    </span>}</li>*@
                        <li>搜索名称：@Html.TextBoxFor(x => x.Name, new { @class = "long_input" })
                            @Html.ValidationMessageFor(x => x.Name)</li>
                        @*<li>邮件订阅：@Html.DropDownListFor(
                   x => x.Frequency,
                   ViewBag.Frequencys as SelectList,
                             null,
                            new { @class = "long_select", @style = "width:100px;" })</li>
                        <li>发送个数：@Html.DropDownListFor(
                   x => x.Deliveries,
                   ViewBag.Deliveriess as SelectList,
                             null,
    new { @class = "long_select", @style = "width:100px;" }) </li>*@
                        <li></li>
                    </ul>
                </div>
                <div class="rebook_btns">
                    @Html.HiddenFor(x => x.Id)
                    @Html.HiddenFor(x => x.Categories)
                    <input type="image" id="btnSubmit" src="../../../Administration/Content/images/icons-save-64-19.png" />
                    或 @Html.ActionLink("取消", "SavedSearchManage", "JobHunting")
                </div>
            </div>
        </div>
    </div>    
}